package com.qingke.easyjava.springmvc.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloController {

    @RequestMapping("/greeting")
    public ModelAndView greeting(@RequestParam(value="name", defaultValue="World") String name) {
        System.out.println("Hello " + name);
        
        Map<String, Object> map = new HashMap<>();
        map.put("name", name);

        return new ModelAndView("hello", map);
    }
}
